use MapManagerTestHelper;
use MapManager;
use Map;

$mgr = MapManager->new();

testClass($mgr, "MapManager");

@hashKeys = ("MAPS"); 
@arrayKeys = ();
@scalarKeys = ();
@expected = (@hashKeys, @arrayKeys, @scalarKeys);

testFields($mgr, \@expected, \@hashKeys, \@scalarKeys, \@arrayKeys);

$map = Map->new(10, 10);

$key = "TESTMAP";
testRegistering($mgr, $map, $key);
print "\n";

testUnregistering($mgr, $map, $key);
print "\n";

$mgr->registerMap($map, $key);

$map2 = Map->new(20, 23);
$key2 = "SELECTION_TEST";
$mgr->registerMap($map2, $key2);
print "\n";

$mgr->select($key2);
testSelecting($mgr, $map2);
print "\n";

print "(***MUST FAIL***)\n";
testSelecting($mgr, $map);
print "\n";

$mgr->select($key);
testSelecting($mgr, $map);
print "\n";

print "(***MUST FAIL***)\n";
testSelecting($mgr, $map2);
print "\n";
